//
//  SearchResultPage.swift
//  test1
//
//  Created by Apple on 2021/6/9.
//

import SwiftUI

struct SearchResultPage: View {
    @EnvironmentObject var modelData : HistoryListModelData
    var url: String
    @State var title: String = "默认"
    var body: some View {
        VStack{
            SearchBar()
            if !modelData.isEditing {
                WebView(url: url)
            } else {
                Search(currentPageUrl: url, currentPageTitle:title, currentPageLogo: Image("baidu"))
            }
            
        }
     
        
    }
}

struct SearchResultPage_Previews: PreviewProvider {
    static var previews: some View {
        SearchResultPage(url: "https://www.baidu.com/s?ie=utf-8&f=8&wd=swift", title: "swift_百度搜索")
            .environmentObject(HistoryListModelData())
    }
}
